$(function(){
	$("#searchVisiterInfoCount_dategrid").datagrid_init;
	/*==初始化表格*/
	$('#searchVisiterInfoCount_dategrid').datagrid({
		loadMsg : "数据加载中",
        emptyMsg : "数据加载完成,当前无数据!",
		border:false,
		fit : true,
		title : "访客信息统计",
		fitColumns : true,
		pagination : true,
		rownumbers : true,
		singleSelect : true,
		toolbar:"#searchVisiterInfoCount_dategrid_toolbar",
		columns : [ [
		    {field : 'id',				title : '主键',			width:50 , align:'center',hidden:true},
		    {field : 'name',		title : '姓名',			width:50 , align:'center',hidden:false},
		    {field : 'gender',				title : '性别',			width:50 , align:'center',hidden:false,
		    	formatter: function(value,row,index){
					return 	value;
				}
		    },
		    {field : 'category',			title : '人员类别',		width:50 , align:'center',hidden:false,
		    	formatter: function(value,row,index){
                    return 	value;
				}
		    },
		    
		    {field : 'idnum',			title : '身份证号',		width:50 , align:'center',hidden:false,
		    	formatter: function(value,row,index){
		    		return value;
		    	}
		    },
		    {field : 'recotime',				title : '进场时间',			width:50 , align:'center',hidden:false,
		    	formatter: function(value,row,index){
					return value;
				}
		    },
		    {field : 'ssbm',			title : '所属部门',			width:50 , align:'center',hidden:false}
		] ],
        onLoadSuccess:function(data){
            $(this).datagrid('doCellTip',{'max-width':'300px','delay':500});
        }
	});

	var params = {};
    params.category = "访客";
	$("#searchVisiterInfoCount_dategrid").datagrid_pagination(basepath+"/user/v1/selectRecordList",JSON.stringify(params),"","" );

    /*查询按钮*/
	$("#searchVisiterInfoCount_btn_search").linkbutton({
		onClick:function(){
			var name = $("#searchVisiterInfoCount_Name").textbox("getValue");
            var datebegin=$.trim($("#searchVisiterInfoCount_DateBegin").datetimebox('getValue'));
            var dateend=$.trim($("#searchVisiterInfoCount_DateEnd").datetimebox('getValue'));
			var params = {};
			params.name = name;
			params.datebegin = datebegin;
			params.dateend = dateend;
			params.category = "访客";
            $("#searchVisiterInfoCount_dategrid").datagrid_pagination(basepath+"/user/v1/selectRecordList",JSON.stringify(params),"","" );
		}
	});

});
	